package com.party.core.service.charge;

import com.party.common.paging.Page;
import com.party.core.model.charge.PackageMember;
import com.party.core.model.charge.PackageMemberWithAuthor;
import com.party.core.service.IBaseService;

import java.util.List;
import java.util.Map;

/**
 * 等级与会员中间表
 */
public interface IPackageMemberService extends IBaseService<PackageMember> {

    List<PackageMember> newListPage(PackageMember packageMember, Map<String, Object> params);

    /**
     * 获取最高等级的套餐关系
     *
     * @param packageMember 套餐关系
     * @param params
     * @return
     */
    PackageMember getMaxPackageRole(PackageMember packageMember, Map<String, Object> params);

    /**
     * 获取最高等级的套餐关系
     *
     * @param memberId 用户Id
     * @param type     套餐类型
     * @return
     */

    List<PackageMember> getPackageMemberByType(String memberId, int type, Page page);

    /**
     * 根据订单id获取关系
     *
     * @param orderId 订单id
     * @return
     */
    PackageMember findByOrderId(String orderId);

    /**
     * @Description:系统购买列表
     * @Param:
     * @return:
     * @Author: Hua Qunhao
     * @Date: 2019/5/23
     */
    List<PackageMember> systemBuyList(PackageMember packageMember,Page page);

    /** 
    * @Description:是否有待付款和审核中的订单
    * @Param:  
    * @return:  
    * @Author: Hua Qunhao
    * @Date: 2019-05-23-0023 
    */ 
   boolean isUnpaidOrder(String memberId);


    /**
     * @Description:查询所有有待付款和审核中的订单
     * @Param:memberId
     * @return:
     * @Author: Hua Qunhao
     * @Date: 2019-05-23-0023
     */
    List<PackageMember> queryAllUnpaidOrder(String memberId);

    /**
     * @Author yifeng
     * @Description admin系统订单列表
     * @Date 17:37 2019/5/24
     * @param packageMember
     * @param params
     * @param page
     * @return
     **/
    List<PackageMemberWithAuthor> packageMemberWebList(PackageMember packageMember, Map<String, Object> params, Page page);


    /**
     * @Description: 获取待支付(待审核)的系统购买订单
     * @Param: createDate
     * @return:
     * @Author: Hua Qunhao
     * @Date: 2019/5/26
     */
    List<PackageMember> queryUnpaidPayPMList(String createDate);

    /**
    * @Author hzq
    * @Description //根据memberId获取最近支付成功的packageMember
    * @Date 13:44 2019/5/30
    * @param memberId 机构id
    * @return
    **/
    List<PackageMember> getLatelyPaySuccess(String memberId);
}
